/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2025/6/17
 * Time: 22:35
 */

#ifndef EFFECT_H
#define EFFECT_H

#include "../affiliate/SpriteAnim.h"
#include "../core/ObjectWorld.h"

class SpriteAnim;
class Effect : public ObjectWorld
{

public:
    static Effect * AddEffectChild(Object * _parent, const std::string & _file_path, glm::vec2 _pos, float _scale = 1.0f, ObjectWorld * _next_object = nullptr);

    void Update(float _dt) override;

    void         SetSpriteAnim(SpriteAnim * _sprite) { sprite_ = _sprite; }
    SpriteAnim * GetSpriteAnim() { return sprite_; }

    void          SetNextObject(ObjectWorld * _next_object) { next_object_ = _next_object; }
    ObjectWorld * GetNextObject() { return next_object_; }

private:
    void CheckFinish();

private:
    SpriteAnim *  sprite_ {nullptr};
    ObjectWorld * next_object_ {nullptr};// 播放完毕后添加到场景中。
};

#endif//EFFECT_H
